import request from '@/utils/request'
import qs from 'qs'
export function addDevice(data) {
  return request({
    url: '/device/deviceManager/add',
    method: 'post',
    data
  })
}
export function editDevice(data) {
  return request({
    url: '/device/deviceManager/edit',
    method: 'post',
    data
  })
}
export function removeDevice(params) {
  return request({
    url: '/device/deviceManager/remove',
    method: 'get',
    params
  })
}

export function addScene(data) {
  return request({
    url: '/scene/sceneManager/add',
    method: 'post',
    data
  })
}
export function editScene(data) {
  return request({
    url: '/scene/sceneManager/edit',
    method: 'post',
    data
  })
}
export function addMachine(data) {
  return request({
    url: '/instrument/instrumentInfo/add',
    method: 'post',
    data
  })
}
export function removeMachine(params) {
  return request({
    url: '/instrument/instrumentInfo/remove',
    method: 'get',
    params
  })
}
export function removeUser(params) {
  return request({
    url: '/system/user/remove',
    method: 'get',
    params
  })
}
export function userEdit(data) {
  return request({
    url: '/system/user/edit',
    method: 'post',
    data
  })
}
export function removeReport(params) {
  return request({
    url: '/file/manager/remove',
    method: 'get',
    params
  })
}
export function removeReportDownload(params) {
  return request({
    url: '/file/loadRecord/remove',
    method: 'get',
    params
  })
}

export function removeRole(params) {
  return request({
    url: '/system/role/remove',
    method: 'get',
    params
  })
}
export function roleEdit(data) {
  return request({
    url: '/system/role/edit',
    method: 'post',
    data
  })
}
export function editMachine(data) {
  return request({
    url: '/instrument/instrumentInfo/edit',
    method: 'post',
    data
  })
}
export function orderList(params) {
  console.log(params)
  return request({
    url: '/common/comdManager/getOperationalComdList',
    method: 'get',
    params
  })
}
export function getParmByComdList(params) {
  console.log(params)
  return request({
    url: '/common/parmManager/getParmByComdList',
    method: 'get',
    params
  })
}
export function addComd(data) {
  console.log(data)
  return request({
    url: '/common/comdManager/add',
    method: 'post',
    data
  })
}
export function editComd(data) {
  console.log(data)
  return request({
    url: '/common/comdManager/edit',
    method: 'post',
    data
  })
}
export function delComd(params) {
  return request({
    url: '/common/comdManager/remove',
    method: 'get',
    params
  })
}
export function addParams(data) {
  console.log(data)
  return request({
    url: '/common/parmManager/add',
    method: 'post',
    data
  })
}
export function delParams(params) {
  return request({
    url: '/common/parmManager/remove',
    method: 'get',
    params
  })
}
export function editParams(data) {
  console.log(data)
  return request({
    url: '/common/parmManager/edit',
    method: 'post',
    data
  })
}
export function getParmByDeviceAndInstrument(data) {
  console.log(data)
  return request({
    url: '/common/parmManager/getParmByDeviceAndInstrument',
    method: 'post',
    data
  })
}
export function createTmpl(data) {
  console.log(data)
  return request({
    url: '/scene/sceneManager/createTmpl',
    method: 'post',
    data
  })
}
export function removeTmpl(params) {
  return request({
    url: '/tmpl/manager/remove',
    method: 'get',
    params
  })
}
export function removeRecord(data) {
  return request({
    url: '/tmpl/sceneTestRecord/remove',
    method: 'post',
    data
  })
}
export function createSceneByTmpl(data) {
  return request({
    url: '/tmpl/manager/createSceneByTmpl',
    method: 'post',
    data
  })
}
export function removeScene(params) {
  return request({
    url: '/scene/sceneManager/remove',
    method: 'get',
    params
  })
}
export function roleAdd(data) {
  return request({
    url: '/system/role/add',
    method: 'post',
    data
  })
}
export function userAdd(data) {
  return request({
    url: '/system/user/add',
    method: 'post',
    data
  })
}
export function userResetPwd(data) {
  return request({
    url: '/system/user/resetPwd',
    method: 'post',
    data
  })
}
export function getHistoryParmList(data) {
  return request({
    url: '/scene/sceneTestParmRecord/getHistoryParmList',
    method: 'post',
    data
  })
}
export function downLoadTmplFile(params) {
  return request({
    url: '/tmpl/manager/downLoadTmplFile',
    method: 'get',
    params
  })
}
export function downLoadReportlFile(params) {
  return request({
    url: '/file/manager/downLoadFile',
    method: 'get',
    params
  })
}
export function getSceneDecs(params) {
  return request({
    url: '/scene/sceneManager/getSceneDecs',
    method: 'get',
    params
  })
}
export function dictAdd(data) {
  return request({
    url: '/system/dict/add',
    method: 'post',
    data
  })
}

export function dictTypeAdd(data) {
  return request({
    url: '/system/dict/data/add',
    method: 'post',
    data
  })
}
export function dictEdit(data) {
  return request({
    url: '/system/dict/edit',
    method: 'post',
    data
  })
}
export function removeDict(params) {
  return request({
    url: '/system/dict/remove',
    method: 'get',
    params
  })
}
export function removeTypeDict(params) {
  return request({
    url: '/system/dict/data/remove',
    method: 'get',
    params
  })
}

export function removeMenu(params) {
  return request({
    url: '/system/menu/remove/' + params,
    method: 'get'
  })
}
export function menuAdd(data) {
  return request({
    url: '/system/menu/add',
    method: 'post',
    data
  })
}
export function menuEdit(data) {
  return request({
    url: '/system/menu/edit',
    method: 'post',
    data
  })
}
export function getSysDictDataDesc(params) {
  return request({
    url: '/system/dict/getDictDesc',
    method: 'get',
    params
  })
}

export function getParmListByDeviceIdOrInstrumentId(data) {
  return request({
    url: '/common/parmManager/getParmListByDeviceIdOrInstrumentId',
    method: 'post',
    data
  })
}
export function sceneParentNodeManagerremove(params) {
  return request({
    url: '/scene/sceneParentNodeManager/remove',
    method: 'get',
    params
  })
}
